import request from '@/utils/request'

// 所有设备类型列表
export function getDeviceTypeList(param) {
  return request({
    url: 'rest/deviceType/list',
    method: 'post',
    data: param
  })
}

// 实际机电设备类型列表
export function getCurrentDeviceTypeList(param) {
  return request({
    url: 'rest/deviceType/deviceTypeList',
    method: 'post',
    data: param
  })
}

// 设备类型删除
export function deleteDeviceType(param) {
  return request({
    url: 'rest/deviceType/delete',
    method: 'post',
    data: param
  })
}

// 设备类型 by 设施id
export function deviceTypeListByStructureId(param) {
  return request({
    url: 'rest/deviceType/listByStructureId',
    method: 'post',
    data: param
  })
}

// 设备类型保存
export function saveDeviceType(param) {
  return request({
    url: 'rest/deviceType/save',
    method: 'post',
    data: param
  })
}

// 测点列表
export function getMeasureList(param) {
  return request({
    url: 'rest/deviceType/measureList',
    method: 'post',
    data: param
  })
}

// 测点保存
export function saveMeasure(param) {
  return request({
    url: 'rest/deviceType/saveMeasure',
    method: 'post',
    data: param
  })
}

// 测点删除
export function deleteMeasure(param) {
  return request({
    url: 'rest/deviceType/deleteMeasure',
    method: 'post',
    data: param
  })
}

// 大类小类列表
export function getLargeClass(param) {
  return request({
    url: 'rest/deviceType/getParentOrSonList',
    method: 'post',
    data: param
  })
}

export function getSonListByParentId(param, isConstruction = true) {
  if (!isConstruction) {
    param.construction = false
  }
  return request({
    url: 'rest/deviceType/getSonListByParentId',
    method: 'post',
    data: param
  })
}

export function getDeviceType(param) {
  return request({
    url: 'rest/deviceType/get',
    method: 'post',
    data: param
  })
}

